- name: make the app be real
  hosts: os_control[0]:os_control_stg[0]
  user: root
  gather_facts: False

  vars_files:
    - /srv/web/infra/ansible/vars/global.yml
    - "/srv/private/ansible/vars.yml"
    - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  roles:
  - role: openshift/project
    app: silverblue
    description: teamsilverblue.org static website
    appowners:
    - misc
    - sanja
  - role: openshift/object
    app: silverblue
    template: imagestream.yml
    objectname: imagestream.yml
  - role: openshift/object
    app: silverblue
    template: buildconfig.yml
    objectname: buildconfig.yml

  - role: openshift/start-build
    app: silverblue
    buildname: silverblue-build
    objectname: silverblue-build

  - role: openshift/object
    app: silverblue
    file: service.yml
    objectname: service.yml

  - role: openshift/route
    app: silverblue
    routename: silverblue
    host: "teamsilverblue.org"
    serviceport: 8080-tcp
    servicename: silverblue
    when: env == "production" 

  - role: openshift/route
    app: silverblue
    routename: silverblue
    host: "silverblue{{ env_suffix }}.fedoraproject.org"
    serviceport: 8080-tcp
    servicename: silverblue

  - role: openshift/object
    app: silverblue
    file: deploymentconfig.yml
    objectname: deploymentconfig.yml

  - role: openshift/rollout
    app: silverblue
    dcname: silverblue
